gtkcssprovider: Free shorthand border GValues in the right place
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 30 May 2011 17:29:22 +0000 (19:29 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 30 May 2011 17:29:22 +0000 (19:29 +0200)
The call to gtk_border_free() within unpack_border() felt completely
in the wrong place, as the border actually pertains to the GValue
being unpacked. Plus, the GValue itself was also being leaked.

gtk/gtkcssprovider.c
gtk/gtkstyleproperty.c

index e1b9b33bcdd799af68b2c3572728f422df956e74..289352193967a6d35440df42ea9f12eb15fe88da 100644 (file)
@@ -1092,6 +1092,7 @@ gtk_css_ruleset_add (GtkCssRuleset          *ruleset,
           gtk_css_ruleset_add (ruleset, child, value);
         }
       g_free (parameters);
+      property_value_free (value);
       return;
     }
 
index 65cd58b6ae1b3d9672b1ab57673706b74aab5b0e..b2fa41fffbeb6fb15fc92b99b9268cc46158b733 100644 (file)
@@ -1187,8 +1187,6 @@ unpack_border (const GValue *value,
   g_value_init (&parameter[3].value, G_TYPE_INT);
   g_value_set_int (&parameter[3].value, border->right);
 
-  gtk_border_free (border);
-
   *n_params = 4;
   return parameter;
 }